package com.freight.order.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.freight.core.base.FreightBaseEntity;
import com.freight.core.common.utils.SnowFlakeUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * @author huyingtai
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "order_extend")
@TableName("order_extend")
@ApiModel(value = "订单扩展信息")
public class OrderExtend extends FreightBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "车辆轨迹查询状态")
    private String queryState = "0";

    @ApiModelProperty(value = "订单号")
    private Long orderId = SnowFlakeUtil.nextId();

    @ApiModelProperty(value = "车牌号")
    private String vehicleNum;

    @ApiModelProperty(value = "接单经度")
    private Double meetLng;

    @ApiModelProperty(value = "接单纬度")
    private Double meetLat;

    @ApiModelProperty(value = "起始经度")
    private Double beginLng;

    @ApiModelProperty(value = "起始纬度")
    private Double beginLat;

    @ApiModelProperty(value = "结束经度")
    private Double endLng;

    @ApiModelProperty(value = "结束纬度")
    private Double endLat;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "装货时间")
    private Date loadingTime;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "卸货时间")
    private Date dischargeTime;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "预计装货时间")
    private Date estimateLoadingTime;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "预计卸货时间")
    private Date estimateDischargeTime;

}